package utils

import (
	"encoding/json"
	"fmt"
)

func StructToJson(x interface{}) (string, error) {
	jsonBytes, err := json.Marshal(x)
	if err != nil {
		fmt.Println(err)
		return "", err
	}

	return string(jsonBytes), nil
}
